package cn.yusei.teamTribe.util;

import java.util.Random;

public class SaltUtil {

	private static final String string = "1234567890abcdefghijklmnopqrstuvwxyz";
	private static Random rand = new Random();
	private static final int DEFAULT_LENGTH = 16;
	
	public static String getSalt()
	{
		return getSalt(DEFAULT_LENGTH);
	}
	public static String getSalt(int length)
	{
		char[] ch = new char[length];
		for(int i=0; i<length; i++)
		{
			ch[i] = string.charAt(rand.nextInt(string.length()));
		}
		return new String(ch);
	}
	
}
